package com.test.javafaq_faq.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.test.javafaq_commons.entity.Answer;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* <p>
    *  Mapper 接口
    * </p>
*
* @author test.com
* @since 2025-04-11
*/
@Repository
public interface AnswerMapper extends BaseMapper<Answer> {

    @Update("update answer set accept_status=#{acceptStatus} where id=#{answerId}" )
    Integer updateAcceptStatus(Integer answerId,Integer acceptStatus);

    //根据 quest_id查询所有答案及回答的所有评论的方法
    List<Answer> findAnswersWithCommentByQuestionId(Integer qid);
}
